//
//  NBJRootViewController.h
//  nbj
//
//  Created by Francois Proulx on 09-09-20.
//  Copyright 2009 Toujours Saoul. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NBJViewController.h"

#import "EventsGeoRSSImporter.h"

@class NBJSuggestionAnnotation;
@class NBJEventAnnotation;

typedef enum {
	NBJRootViewControllerModeUnknown = -1,
	NBJRootViewControllerModeMap = 0,
	NBJRootViewControllerModeList = 1
} NBJRootViewControllerMode;

@interface NBJRootViewController : NBJViewController<NSFetchedResultsControllerDelegate, UITableViewDelegate, UITableViewDataSource, MKMapViewDelegate, UISearchDisplayDelegate, UISearchBarDelegate, EventsGeoRSSImporterDelegate, UIAccelerometerDelegate, MFMailComposeViewControllerDelegate, UINavigationControllerDelegate, UIAlertViewDelegate> {
	UIView *contentView;
	MKMapView *mapView;
	UITableView *tableView;
	UIToolbar *toolbar;
	UISegmentedControl *modeSelectionControl;
	
	EventsGeoRSSImporter *importer;
	NSOperationQueue *operationQueue;
	
	NBJRootViewControllerMode currentMode;
	NSFetchedResultsController *eventResultsController;
	NSMutableArray *filteredEventsList;
	
	UIAcceleration *lastAcceleration;
	NSUInteger shakeCount;
	
	NBJSuggestionAnnotation *barSuggestionAnnotation;
	NBJEventAnnotation *selectedBarAnnotation;
}

@property (nonatomic, retain) IBOutlet UIView *contentView;
@property (nonatomic, retain) IBOutlet MKMapView *mapView;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) IBOutlet UISegmentedControl *modeSelectionControl;
@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;

- (IBAction) geolocate;
- (IBAction) suggestNewBar;
- (IBAction) rootViewModeChanged:(id)sender;

@end
